const mysql = require('mysql2');

const pool = mysql.createPool({
    host: 'localhost',
    user: 'root',
    password:'ddd',
    database: 'user',
});

function excute(sqlString,condition){
    let result = new Promise((resolve,reject) => {
        pool.query(sqlString,condition,function(err, result, fields){
            if(err){
                reject(err)
            }
            else{
                resolve(result)
            }
        })
    })
    return result;
}

module.exports = {
    EXCUTE:excute
}